

import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:wechat_manager/utils/log_util.dart';

class ResponseInterceptor extends Interceptor {

  @override
  void onResponse(Response response, ResponseInterceptorHandler handler) {
    if(response.statusCode == 200) {
      String result = response.toString();
      try {
        response.data = json.decoder.convert(result);
      } catch (e) {
        logger.e(e.toString());
      }
    }
    handler.next(response);
  }
}